com.supermap.ar.areffect
Class ARMapElement
- java.lang.Object
-
- com.supermap.ar.areffect.AREffectElement
-
- com.supermap.ar.areffect.ARMapElement
-
public class ARMapElement extends AREffectElement
AR map elements
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classARMapElement.ActionTypestatic interfaceARMapElement.MapRefreshListenerstatic interfaceARMapElement.OnMapClickListenerMap click listener, used to monitor the starting and ending points in path analysisstatic interfaceARMapElement.OnMapUpdateListenerMap update monitor-
Nested classes/interfaces inherited from class com.supermap.ar.areffect.AREffectElement
AREffectElement.onRenderableLoadCompleteListener, AREffectElement.OnTapListener, AREffectElement.OnTouchListener, AREffectElement.PositionType
-
-
Constructor Summary
Constructors Constructor and Description ARMapElement(android.content.Context context)The constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancheckPoint(Point point, boolean change)Determine whether the point is out of rangePoint3DconvertToArPoint(Point point)Convert the MapView coordinates to the relative coordinates of the parent node in ARPointconvertToMapPoint(Point3D point)Convert AR coordinates to pixel coordinates in MapView, the return value can be nullARMapElement.ActionTypegetActionType()Gets the gesture action typeAREffectElementgetArMapParent()Gets the parent element of the AR mapfloatgetArMapScale()Get the scale of the AR map to the real sceneARViewElementgetArMapSelf()Get ARViewAREffectElementgetArObjParent()Gets the parent element of the corresponding AR object on the AR map to be bound Child objects on the AR map need to be bound to the parent elementjava.util.List<Point3D>getArViewVertice()Gets the vertex set of ARView Note: five points end to endfloat[]getRealScaleFactor()Gets the true scale of the AR scenefloat[]getScaleFactor()Gets the ratio of object in ar worldbooleanisLoaded()Whether the map has been loadedbooleanisRealMode()Determine if it is true mode (1:1 map)voidloadModel(MapView source)Resource to loadvoidsetActionType(ARMapElement.ActionType type)Sets the gesture action typevoidsetMapRefreshListener(ARMapElement.MapRefreshListener listener)Set the map refresh listenervoidsetOnMapClickListener(ARMapElement.OnMapClickListener listener)Set the map click to listenvoidsetOnUpdateListener(ARMapElement.OnMapUpdateListener listener)Set AR map update listenervoidsetRealMode(boolean realMode)Set true mode (with 1:1 map enabled or not)voidsetScaleFactor(float[] scales)Sets the ratio of object in ar worldvoidupdateArMap()update ArMap-
Methods inherited from class com.supermap.ar.areffect.AREffectElement
addChild, addChilds, addOnTapListener, addOnTouchListener, clearAllChilds, destroy, getAllChilds, getChild, getChild, getChild, getChildCount, getElementType, getId, getLocalScaleFactor, getOnRenderableLoadCompleteListener, getPosition, getPositionType, getRelativePosition, getRotationAngle, getRotationAxis, getWGSCoordinates, isShadowCaster, isShadowReceiver, isTransformable, isVisible, removeChild, removeChild, removeChild, removeChild, removeOnTapListener, removeOnTouchListener, setElementName, setLocalScaleFactor, setOnRenderableLoadCompleteListener, setParentNode, setParentNode, setParentNode, setPosition, setRelativePosition, setRelativePosition, setRotateAlwaysToCamera, setRotateToCameraType, setRotationAngle, setShadowCaster, setShadowReceiver, setTransformable, setVisiblity, setWGSCoordinates
-
-
-
-
Constructor Detail
-
ARMapElement
public ARMapElement(android.content.Context context)
The constructor- Parameters:
context-
-
-
Method Detail
-
setOnUpdateListener
public void setOnUpdateListener(ARMapElement.OnMapUpdateListener listener)
Set AR map update listener- Parameters:
listener-
-
setMapRefreshListener
public void setMapRefreshListener(ARMapElement.MapRefreshListener listener)
Set the map refresh listener- Parameters:
listener-
-
getArMapScale
public float getArMapScale()
Get the scale of the AR map to the real scene- Returns:
-
isRealMode
public boolean isRealMode()
Determine if it is true mode (1:1 map)- Returns:
-
setRealMode
public void setRealMode(boolean realMode)
Set true mode (with 1:1 map enabled or not)- Parameters:
realMode-
-
getScaleFactor
public float[] getScaleFactor()
Description copied from class:AREffectElementGets the ratio of object in ar world- Overrides:
getScaleFactorin classAREffectElement- Returns:
-
setScaleFactor
public void setScaleFactor(float[] scales)
Description copied from class:AREffectElementSets the ratio of object in ar world- Overrides:
setScaleFactorin classAREffectElement- Parameters:
scales- including 3 values that are coefficients of x, y, and z
-
getRealScaleFactor
public float[] getRealScaleFactor()
Gets the true scale of the AR scene- Returns:
-
checkPoint
public boolean checkPoint(Point point, boolean change)
Determine whether the point is out of range- Parameters:
point-change- Out of range, whether to update point coordinates- Returns:
- Is the point within the boundary of the map container
-
convertToArPoint
public Point3D convertToArPoint(Point point)
Convert the MapView coordinates to the relative coordinates of the parent node in AR- Parameters:
point-- Returns:
-
convertToMapPoint
public Point convertToMapPoint(Point3D point)
Convert AR coordinates to pixel coordinates in MapView, the return value can be null- Parameters:
point-- Returns:
-
loadModel
public void loadModel(MapView source)
Resource to load- Parameters:
source-
-
updateArMap
public void updateArMap()
update ArMap
-
getArObjParent
public AREffectElement getArObjParent()
Gets the parent element of the corresponding AR object on the AR map to be bound Child objects on the AR map need to be bound to the parent element- Returns:
-
getArMapParent
public AREffectElement getArMapParent()
Gets the parent element of the AR map- Returns:
-
getArMapSelf
public ARViewElement getArMapSelf()
Get ARView- Returns:
-
getArViewVertice
public java.util.List<Point3D> getArViewVertice()
Gets the vertex set of ARView Note: five points end to end- Returns:
-
setActionType
public void setActionType(ARMapElement.ActionType type)
Sets the gesture action type- Parameters:
type-
-
getActionType
public ARMapElement.ActionType getActionType()
Gets the gesture action type- Returns:
-
isLoaded
public boolean isLoaded()
Whether the map has been loaded- Returns:
-
setOnMapClickListener
public void setOnMapClickListener(ARMapElement.OnMapClickListener listener)
Set the map click to listen- Parameters:
listener-
-
-